﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

class ExaminationMoveField : MonoBehaviour
{
    public ExaminationMove m_Boss = null;
    float m_CollisionIntervalCount = 0;
    float m_CollisionIntervalMax = 1.5f;

    bool m_IsEnabled = true;
    private void Update()
    {
        if(m_IsEnabled == false)
        {
            m_CollisionIntervalCount += Time.deltaTime;
            if (m_CollisionIntervalCount > m_CollisionIntervalMax)
            {
                m_IsEnabled = true;
                m_CollisionIntervalCount = 0;
            }
        }
    }
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if(m_IsEnabled)
            m_Boss.OnCollision();
        m_IsEnabled = false;
    }
}